var prefix = ctx + "module/order"

$(function() {
	var columns = [{
            checkbox: true
        },
				{
			field : 'orderId', 
			title : '订单id' 
		},
				{
			field : 'orderNum', 
			title : '订单号' 
		},
				{
			field : 'orderStatus',
			title : '订单状态',
			formatter : function(value, row, index) {
				if (value == 1) {
					return '<span class="label">部门待跟进</span>';
				}
			}
		},
				{
			field : 'typeName', 
			title : '订单类型' 
		},
				{
			field : 'deptName', 
			title : '部门' 
		},
				{
			field : 'createBy', 
			title : '跟进客服' 
		},
		        {
            title: '操作',
            align: 'center',
            formatter: function(value, row, index) {
            	var actions = [];
				actions.push('<a class="btn btn-primary btn-sm ' + detailsFlag + '" href="#" title="派单" mce_href="#" onclick="details(\'' + row.orderId + '\')"><i class="fa fa-hand-pointer-o"></i></a> ');
				return actions.join('');
            }
        }];
	var url = prefix + "/dispatchSalesmanList";
	$.initTable(columns, url);
});

/*订单-详情*/
function details(orderId) {
    var url = prefix + '/dispatchSalesmanDetails/' + orderId;
    layer_showAuto("业务员订单详情", url);
}

